package thread.thread2;

public class Passenger implements Runnable {
	private String name;

	public Passenger(String name) {
		this.name = name;
	}

	@Override
	public void run() {
		System.out.println(name + "抵达了车站");
		for (int i = 1; i <= 30; i++) {
			System.out.println(name + "坐火车跑了" + i * 100 + "公里");
		}
		System.out.println(name + "抵达了上海");
	}

	public static void main(String[] args) {
		Thread t1 = new Thread(new Passenger("孙成旭"));
		Thread t2 = new Thread(new Passenger("林吸入"));
		t1.start();
		t2.start();
		try {
			t1.join();
			t2.join();
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		System.out.println("一起出站了");

	}

}
